<template>
  <view>
    <view>健康百科</view>

    <button @click="fn">开启</button>
    <!-- <button @click="fn2">关闭</button> -->

    <!-- popup弹层必须利用ref先获取组件  调用open -->
    <uni-popup ref="popup" type="bottom">
      <view>我是弹层内容</view>
      <view>我是弹层内容</view>
      <view>我是弹层内容</view>
      <view>我是弹层内容</view>
      <view>我是弹层内容</view>
      <view>我是弹层内容</view>
      <view>我是弹层内容</view>
    </uni-popup>
  </view>
</template>

<script setup lang="ts">
  import { ref } from 'vue'

  const popup = ref() // popup.value.open

  const fn = () => {
    popup.value.open()

    setTimeout(() => {
      popup.value.close()
    }, 4000)
  }
</script>

<style lang="scss" scoped></style>
